/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pe.edu.pucp.sigepa.recocidosimulado.Modelo;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author carloslengua
 */
@Entity
@Table(name = "pronostico_sim")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "PronosticoSim.findAll", query = "SELECT p FROM PronosticoSim p"),
    @NamedQuery(name = "PronosticoSim.findByIdpronostico", query = "SELECT p FROM PronosticoSim p WHERE p.idpronostico = :idpronostico"),
    @NamedQuery(name = "PronosticoSim.findByFechareg", query = "SELECT p FROM PronosticoSim p WHERE p.fechareg = :fechareg"),
    @NamedQuery(name = "PronosticoSim.findByNropack", query = "SELECT p FROM PronosticoSim p WHERE p.nropack = :nropack")})
public class PronosticoSim implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idpronostico")
    private Integer idpronostico;
    @Basic(optional = false)
    @Column(name = "fechareg")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fechareg;
    @Basic(optional = false)
    @Column(name = "nropack")
    private int nropack;
    @JoinColumn(name = "idaeropuerto", referencedColumnName = "idaeropuerto")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private AeropuertoSim aeropuertoSim;

    public PronosticoSim() {
    }

    public PronosticoSim(Integer idpronostico) {
        this.idpronostico = idpronostico;
    }

    public PronosticoSim(Integer idpronostico, Date fechareg, int nropack) {
        this.idpronostico = idpronostico;
        this.fechareg = fechareg;
        this.nropack = nropack;
    }

    public Integer getIdpronostico() {
        return idpronostico;
    }

    public void setIdpronostico(Integer idpronostico) {
        this.idpronostico = idpronostico;
    }

    public Date getFechareg() {
        return fechareg;
    }

    public void setFechareg(Date fechareg) {
        this.fechareg = fechareg;
    }

    public int getNropack() {
        return nropack;
    }

    public void setNropack(int nropack) {
        this.nropack = nropack;
    }

    public AeropuertoSim getAeropuertoSim() {
        return aeropuertoSim;
    }

    public void setAeropuertoSim(AeropuertoSim aeropuertoSim) {
        this.aeropuertoSim = aeropuertoSim;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idpronostico != null ? idpronostico.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PronosticoSim)) {
            return false;
        }
        PronosticoSim other = (PronosticoSim) object;
        if ((this.idpronostico == null && other.idpronostico != null) || (this.idpronostico != null && !this.idpronostico.equals(other.idpronostico))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "pe.edu.pucp.sigepa.recocidosimulado.Modelo.PronosticoSim[ idpronostico=" + idpronostico + " ]";
    }
    
}
